<?php
namespace Home\Controller;
use Think\Controller;

class LiveController extends Controller {

    public function index(){

        $Model = M();

        $sql = "SELECT a.litpic FROM __PICTURE__ AS a LEFT JOIN __PICTURE_CATEGORY__ AS b ON a.cid = b.id WHERE b.key = 'live' ORDER BY a.rank DESC";
        $live = $Model->query($sql);

        $liveReturn = array();
        foreach($live as $v){

            $liveReturn[] = array(
                'imgUrl' => C('PICDOMAIN').C('PICPATH').$v['litpic']
            );
        }

        $this->ajaxReturn($liveReturn);
    }
}